package cn.dujc.superkid.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * @author du
 * date 2018/8/2 下午8:51
 */
public class VideoExaminationResultsResult implements Parcelable{
    /**
     * results : [{"num":"1","user":631,"AnswerRight":606,"CorrectRate":96.04,"UserAnswer":"A","row":"错误","analysis":2984}]
     * page_info : {"num":10,"average":10,"total_score":0,"examination_title":"认识时间（1）测试卷","examine_title":"认识时间（1）测试卷"}
     * score_statistics : [{"group_name":"100分","score":26.18,"color":"#EAEAAE"}]
     */

    private PageInfoEntity page_info;//页面返回信息
    private List<ResultsEntity> results;//统计的结果
    private List<ScoreStatisticsEntity> score_statistics;//考试得分统计 (饼图)

    public PageInfoEntity getPage_info() { return page_info;}

    public void setPage_info(PageInfoEntity page_info) { this.page_info = page_info;}

    public List<ResultsEntity> getResults() { return results;}

    public void setResults(List<ResultsEntity> results) { this.results = results;}

    public List<ScoreStatisticsEntity> getScore_statistics() { return score_statistics;}

    public void setScore_statistics(List<ScoreStatisticsEntity> score_statistics) { this.score_statistics = score_statistics;}

    @Override
    public int describeContents() { return 0; }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeParcelable(this.page_info, flags);
        dest.writeTypedList(this.results);
        dest.writeTypedList(this.score_statistics);
    }

    public VideoExaminationResultsResult() {}

    protected VideoExaminationResultsResult(Parcel in) {
        this.page_info = in.readParcelable(PageInfoEntity.class.getClassLoader());
        this.results = in.createTypedArrayList(ResultsEntity.CREATOR);
        this.score_statistics = in.createTypedArrayList(ScoreStatisticsEntity.CREATOR);
    }

    public static final Creator<VideoExaminationResultsResult> CREATOR = new Creator<VideoExaminationResultsResult>() {
        @Override
        public VideoExaminationResultsResult createFromParcel(Parcel source) {return new VideoExaminationResultsResult(source);}

        @Override
        public VideoExaminationResultsResult[] newArray(int size) {return new VideoExaminationResultsResult[size];}
    };

    public static class PageInfoEntity implements Parcelable{
        /**
         * num : 10
         * average : 10
         * total_score : 0
         * examination_title : 认识时间（1）测试卷
         * examine_title : 认识时间（1）测试卷
         */

        private String num;//题目总数
        private String average;//平均分
        private String total_score;//本次得分
        private String examination_title;//自测卷标题
        private String examine_title;//自测卷标题

        public String getNum() { return num;}

        public void setNum(String num) { this.num = num;}

        public String getAverage() { return average;}

        public void setAverage(String average) { this.average = average;}

        public String getTotal_score() { return total_score;}

        public void setTotal_score(String total_score) { this.total_score = total_score;}

        public String getExamination_title() { return examination_title;}

        public void setExamination_title(String examination_title) { this.examination_title = examination_title;}

        public String getExamine_title() { return examine_title;}

        public void setExamine_title(String examine_title) { this.examine_title = examine_title;}

        @Override
        public int describeContents() { return 0; }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.num);
            dest.writeString(this.average);
            dest.writeString(this.total_score);
            dest.writeString(this.examination_title);
            dest.writeString(this.examine_title);
        }

        public PageInfoEntity() {}

        protected PageInfoEntity(Parcel in) {
            this.num = in.readString();
            this.average = in.readString();
            this.total_score = in.readString();
            this.examination_title = in.readString();
            this.examine_title = in.readString();
        }

        public static final Creator<PageInfoEntity> CREATOR = new Creator<PageInfoEntity>() {
            @Override
            public PageInfoEntity createFromParcel(Parcel source) {return new PageInfoEntity(source);}

            @Override
            public PageInfoEntity[] newArray(int size) {return new PageInfoEntity[size];}
        };
    }
}
